<template>
  <div class="top-info">
    <div class="left">
      <van-image round width="20vw" height="20vw" :src="userInfo.avatar" />
    </div>
    <div class="right">
      <div class="name">
        <span>姓名:</span>
        <span> {{ userInfo.name }}</span>
      </div>
      <div class="stu_id">
        <span>学号:</span>
        <span> {{ userInfo.stu_id }}</span>
      </div>
      <div v-if='isShowGrade' class="grade">
        <span>系别班级:</span>
        <span> {{ userInfo.grade }}</span>
      </div>
    </div>
  </div>
</template>

<script lang="js">
import {defineComponent, reactive, ref} from 'vue'

export default defineComponent({
  props: {
    userInfo:{
      type:Object,
      default(){
        return {}
      }
    },
    isShowGrade:{
      type:Boolean,
      default:true
    }
  },
  components: {

  },
  setup() {


    return {

    }

  }
})
</script>

<style scoped lang="less">
.top-info {
  padding: 6vw;
  background-color: rgb(116, 192, 251);
  color: #f0f0f0;
  min-height: 20vh;
  display: flex;
  align-items: center;
  .left {
    width: 20vw;
  }
  .right {
    flex: 1;
    margin-left: 6vw;
    div {
      display: flex;
      justify-content: space-between;
      margin: 2vw 0;

      span:nth-child(1) {
        // font-weight: 550;
        // font-size: 4.8vw;
      }
      span:nth-child(2) {
        // color: #434343;
      }
    }
  }
}
</style>
